home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tech91.zip / TI699.ASC < prev    next >
Text File  |  1991-08-26  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                                NUMBER  :  699
  9.   VERSION  :  2.0 & up
  10.        OS  :  DOS
  11.      DATE  :  August 26, 1991                          PAGE  :  1/2
  12.  
  13.     TITLE  :  Implementing Fieldview in a PAL Application
  14.  
  15.  
  16.  
  17.  
  18.   In a WAIT TABLE or WAIT RECORD statement that lists <Insert> and
  19.   <Delete> in its UNTIL clause, additional programming must be done
  20.   to process Fieldview correctly.  While in WAIT TABLE or WAIT
  21.   RECORD the user can enter Fieldview by pressing <Alt-F5> or
  22.   <Ctrl-F>.  Without additional programming, the following problem
  23.   will arise.  When the user presses <Insert> or <Delete> while in
  24.   Fieldview, the Paradox code to handle <Insert> and <Delete> is
  25.   invoked causing Paradox to insert or delete a record rather
  26.   inserting or deleting a character.
  27.  
  28.   In Fieldview mode, <Insert> and <Delete> should insert and delete
  29.   characters, and in Edit and Coedit mode, these keys should insert
  30.   and delete records.
  31.  
  32.   The correct way to implement <Insert> and <Delete> in Fieldview
  33.   is to add Fieldview to the Until clause of the WAIT statement.
  34.   The following PAL program demonstrates this method.
  35.  
  36.   ===============================================================
  37.   COEDIT "Customer"                    ; Coedit the Customer Table
  38.  
  39.   WHILE TRUE
  40.  
  41.         WAIT RECORD
  42.         UNTIL "DO_IT!","FIELDVIEW","DEL","INS","PGUP","PGDN"
  43.                       ; Note Fieldview in above line
  44.         SWITCH
  45.             CASE RETVAL = "DO_IT!"    :  ; <Do_It!> pressed
  46.                  DO_IT!
  47.                  QUIT
  48.  
  49.             CASE RETVAL = "FIELDVIEW" :
  50.                  FIELDVIEW
  51.                       ; Fieldview handling code
  52.                       ; Invoke Fieldview, wait for Enter to be
  53.   pressed
  54.  
  55.                  WAIT FIELD
  56.                     PROMPT "Press Enter to end fieldview",""
  57.                  UNTIL "ENTER"
  58.                       ; User may insert and delete characters while
  59.                         in
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox                                NUMBER  :  699
  75.   VERSION  :  2.0 & up
  76.        OS  :  DOS
  77.      DATE  :  August 26, 1991                          PAGE  :  2/2
  78.  
  79.     TITLE  :  Implementing Fieldview in a PAL Application
  80.  
  81.  
  82.  
  83.  
  84.                       ; Fieldview
  85.  
  86.             OTHERWISE :                        ; Process other keys
  87.                  KEYPRESS RETVAL
  88.         ENDSWITCH
  89.  
  90.   ENDWHILE
  91.  
  92.   ===============================================================
  93.  
  94.   This program places the "Customer" table into Coedit mode, then
  95.   uses WAIT RECORD to allow the user to edit the table until
  96.   <DO_IT!>, <FIELDVIEW>, <DELETE>, <INSERT>, <PGUP>, <PGDN> is
  97.   pressed.  When the user enters Fieldview mode, by pressing <Alt-
  98.   F5> or <Ctrl-F>, the program uses a WAIT FIELD statement to allow
  99.   the user to make changes to the field.  While in Fieldview the
  100.   user can press <INSERT> and <DELETE> to insert and delete
  101.   characters.  When the user presses <Enter>, the Fieldview
  102.   terminates and returns to the WAIT TABLE statement allowing the
  103.   user to continue Coediting the table.  When a user presses
  104.   <INSERT>, and <DELETE> in CoEdit mode, these keys insert and
  105.   delete records.
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.